\hypertarget{class_high_score_model}{
\section{HighScoreModel Class Reference}
\label{class_high_score_model}\index{HighScoreModel@{HighScoreModel}}
}


Data model for high scores.  


\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243c}{HighScoreRoles} \{ \par
\hyperlink{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca13486f801ea03b1d29800db13cf5a60b}{RankRole} =  Qt::UserRole + 1, 
\hyperlink{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca78420f3dd03d1f4a39824b823eedf4f8}{NameRole}, 
\hyperlink{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca07f0548bfffd72a5fa690e4a36cc93a4}{ScoreRole}, 
\hyperlink{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca97af695f0dd5c70a4babbe64711aa4e8}{TimeRole}, 
\par
\hyperlink{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca17fc6270ecb9c4b44dafe92a7de1d72a}{DateRole}
 \}
\begin{DoxyCompactList}\small\item\em Data value roles for the \hyperlink{class_high_score_model}{HighScoreModel}. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Slots}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_high_score_model_a32ae61d3e61cf274824fe6fd73d05bc4}{
Q\_\-INVOKABLE QVariantMap \hyperlink{class_high_score_model_a32ae61d3e61cf274824fe6fd73d05bc4}{get} (int row) const }
\label{class_high_score_model_a32ae61d3e61cf274824fe6fd73d05bc4}

\begin{DoxyCompactList}\small\item\em Get single row. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_high_score_model_a739ed637d2446e5485ee6d474e7f3086}{
\hyperlink{class_high_score_model_a739ed637d2446e5485ee6d474e7f3086}{HighScoreModel} (QObject $\ast$parent=0)}
\label{class_high_score_model_a739ed637d2446e5485ee6d474e7f3086}

\begin{DoxyCompactList}\small\item\em Constructs HighScore model. \item\end{DoxyCompactList}\item 
\hypertarget{class_high_score_model_a0729977864f8fd490270d9baafcaf73e}{
\hyperlink{class_high_score_model_a0729977864f8fd490270d9baafcaf73e}{$\sim$HighScoreModel} ()}
\label{class_high_score_model_a0729977864f8fd490270d9baafcaf73e}

\begin{DoxyCompactList}\small\item\em Destructs HighScore model. \item\end{DoxyCompactList}\item 
void \hyperlink{class_high_score_model_a29c104da3a84899edfdb74ea2692a41e}{addItem} (const \hyperlink{class_high_score_item}{HighScoreItem} $\ast$item)
\begin{DoxyCompactList}\small\item\em Add \hyperlink{class_high_score_item}{HighScoreItem} HighScore model. \item\end{DoxyCompactList}\item 
\hypertarget{class_high_score_model_a48c85c2f4186e1b7b4c39b191c1b1c65}{
int \hyperlink{class_high_score_model_a48c85c2f4186e1b7b4c39b191c1b1c65}{rowCount} (const QModelIndex \&parent=QModelIndex()) const }
\label{class_high_score_model_a48c85c2f4186e1b7b4c39b191c1b1c65}

\begin{DoxyCompactList}\small\item\em Number of rows. \item\end{DoxyCompactList}\item 
QVariant \hyperlink{class_high_score_model_a49b093dd22fac8d8e4a9157474bf88c9}{data} (const QModelIndex \&index, int role=Qt::DisplayRole) const 
\begin{DoxyCompactList}\small\item\em Get data item based on role. \item\end{DoxyCompactList}\item 
\hypertarget{class_high_score_model_aeb4782085a57724b31e87d626a39f7fb}{
void \hyperlink{class_high_score_model_aeb4782085a57724b31e87d626a39f7fb}{updateModel} (QList$<$ GameSettings::HighScore $>$ \&highScoreList)}
\label{class_high_score_model_aeb4782085a57724b31e87d626a39f7fb}

\begin{DoxyCompactList}\small\item\em Updates model based on the {\itshape highScoreList\/}. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_high_score_model_afb2c97ad31e93aea5a43044e20785b50}{
QVariantMap \hyperlink{class_high_score_model_afb2c97ad31e93aea5a43044e20785b50}{itemToQVariantMap} (const \hyperlink{class_high_score_item}{HighScoreItem} $\ast$) const }
\label{class_high_score_model_afb2c97ad31e93aea5a43044e20785b50}

\begin{DoxyCompactList}\small\item\em \hyperlink{class_high_score_item}{HighScoreItem} to QVariantMap. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
\hypertarget{class_high_score_model_addc572ee6814b9aeaa7fb9e1208412df}{
QList$<$ const \hyperlink{class_high_score_item}{HighScoreItem} $\ast$ $>$ \hyperlink{class_high_score_model_addc572ee6814b9aeaa7fb9e1208412df}{items}}
\label{class_high_score_model_addc572ee6814b9aeaa7fb9e1208412df}

\begin{DoxyCompactList}\small\item\em High score items at the model. \item\end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Data model for high scores. Used from \hyperlink{_high_scores_8qml}{HighScores.qml} view to show high scores list. \begin{DoxySeeAlso}{See also}
\hyperlink{class_high_score_item}{HighScoreItem} 
\end{DoxySeeAlso}


\subsection{Member Enumeration Documentation}
\hypertarget{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243c}{
\index{HighScoreModel@{HighScoreModel}!HighScoreRoles@{HighScoreRoles}}
\index{HighScoreRoles@{HighScoreRoles}!HighScoreModel@{HighScoreModel}}
\subsubsection[{HighScoreRoles}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf HighScoreModel::HighScoreRoles}}}
\label{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243c}


Data value roles for the \hyperlink{class_high_score_model}{HighScoreModel}. 

\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{RankRole@{RankRole}!HighScoreModel@{HighScoreModel}}\index{HighScoreModel@{HighScoreModel}!RankRole@{RankRole}}\item[{\em 
\hypertarget{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca13486f801ea03b1d29800db13cf5a60b}{
RankRole}
\label{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca13486f801ea03b1d29800db13cf5a60b}
}]Rank of the score. \index{NameRole@{NameRole}!HighScoreModel@{HighScoreModel}}\index{HighScoreModel@{HighScoreModel}!NameRole@{NameRole}}\item[{\em 
\hypertarget{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca78420f3dd03d1f4a39824b823eedf4f8}{
NameRole}
\label{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca78420f3dd03d1f4a39824b823eedf4f8}
}]Name of the player. \index{ScoreRole@{ScoreRole}!HighScoreModel@{HighScoreModel}}\index{HighScoreModel@{HighScoreModel}!ScoreRole@{ScoreRole}}\item[{\em 
\hypertarget{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca07f0548bfffd72a5fa690e4a36cc93a4}{
ScoreRole}
\label{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca07f0548bfffd72a5fa690e4a36cc93a4}
}]Score. \index{TimeRole@{TimeRole}!HighScoreModel@{HighScoreModel}}\index{HighScoreModel@{HighScoreModel}!TimeRole@{TimeRole}}\item[{\em 
\hypertarget{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca97af695f0dd5c70a4babbe64711aa4e8}{
TimeRole}
\label{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca97af695f0dd5c70a4babbe64711aa4e8}
}]Playtime. \index{DateRole@{DateRole}!HighScoreModel@{HighScoreModel}}\index{HighScoreModel@{HighScoreModel}!DateRole@{DateRole}}\item[{\em 
\hypertarget{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca17fc6270ecb9c4b44dafe92a7de1d72a}{
DateRole}
\label{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243ca17fc6270ecb9c4b44dafe92a7de1d72a}
}]Playing date. \end{description}
\end{Desc}



\subsection{Member Function Documentation}
\hypertarget{class_high_score_model_a29c104da3a84899edfdb74ea2692a41e}{
\index{HighScoreModel@{HighScoreModel}!addItem@{addItem}}
\index{addItem@{addItem}!HighScoreModel@{HighScoreModel}}
\subsubsection[{addItem}]{\setlength{\rightskip}{0pt plus 5cm}void HighScoreModel::addItem (
\begin{DoxyParamCaption}
\item[{const {\bf HighScoreItem} $\ast$}]{ item}
\end{DoxyParamCaption}
)}}
\label{class_high_score_model_a29c104da3a84899edfdb74ea2692a41e}


Add \hyperlink{class_high_score_item}{HighScoreItem} HighScore model. 

Ownership is transferred. \hypertarget{class_high_score_model_a49b093dd22fac8d8e4a9157474bf88c9}{
\index{HighScoreModel@{HighScoreModel}!data@{data}}
\index{data@{data}!HighScoreModel@{HighScoreModel}}
\subsubsection[{data}]{\setlength{\rightskip}{0pt plus 5cm}QVariant HighScoreModel::data (
\begin{DoxyParamCaption}
\item[{const QModelIndex \&}]{ index, }
\item[{int}]{ role = {\ttfamily Qt::DisplayRole}}
\end{DoxyParamCaption}
) const}}
\label{class_high_score_model_a49b093dd22fac8d8e4a9157474bf88c9}


Get data item based on role. 

\begin{DoxySeeAlso}{See also}
\hyperlink{class_high_score_model_ae5175bc0a99d255dff76ad955d8d243c}{HighScoreRoles} 
\end{DoxySeeAlso}


The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
highscoremodel.h\item 
highscoremodel.cpp\end{DoxyCompactItemize}
